package secondStage.part2.异常.自定义异常;

public class Teacher {
    public void checkScore(int score) throws UserDefinedException {
        if (score < 0 || score > 100) {
            //throw new UserDefinedException();
            throw new UserDefinedException("你给的分数有误");
        } else {
            System.out.println("分数正常");
        }
    }
}
